package com.netty;

/**
 * 请求处理接口,所有的请求实现必须实现此接口
 */

import com.netty.model.SentBody;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.FullHttpRequest;

public interface CIMWebSocketRequestHandler {
    /**
     * ws链接进行token鉴权
     *
     * @param channel
     * @param httpRequest
     * @return
     */
    boolean loginAuthHandler(Channel channel, FullHttpRequest httpRequest);

    /**
     * 链接成功之后调用该方法
     */
    void channelActive(Channel channel);

    /**
     * 收到消息之后调用该方法
     */
    void channelRead0(Channel channel, SentBody sentBody);

    /**
     * 断开链接
     */
    void channelUnregistered(Channel channel);
}
